Unable to access global variable defined in settings.php [Drupal]
Posted
by Senthil
on Stack Overflow
See other posts from Stack Overflow
or by Senthil
Published on 2010-06-16T11:47:07Z
Indexed on
2010/06/16
11:52 UTC
Read the original article
Hit count: 329
drupal-6
I am developing a website using Drupal 6.16.
I want to define a variable in settings.php
like
$ge_path = 'some/path/here';
And I want to use it inside my modules.
function mymodule_block(....) {
global $ge_path;
$fullPath = $ge_path . '/another/path';
doSomething($fullPath);
}
But I am getting NULL as the value of $ge_path.
Why am I not able to access the global variable defines in settings.php? How can I get the proper value inside my module functions?
The funny thing is, I am able to access $db_url['default']
and $db_url['mydatabase']
etc.. which are defined just two lines above $ge_path in settings.php!
© Stack Overflow or respective owner